#include <iostream>
#include "SerialPort.h"

#pragma pack(1)
struct DataStruct_Sum
{
    uint8_t Flag_up;//决定策略
    float X_up;
    float Y_up;
    float Z_up;

    uint8_t Flag_down;//决定策略
    float X_down;
    float Y_down;
    float Z_down;
    uint8_t end;
};
#pragma pack()

int main(int, char **)
{
    DataStruct_Sum data;
    SerialPort port;
    while (true)
    {
        data.Flag_up = 0;
        data.X_up = 2;
        data.Y_up = 3;
        data.Z_up = 4;
        data.Flag_down = 5;
        data.X_down = 6;
        data.Y_down = 7;
        data.Z_down = 8;
        port.writeStruct<DataStruct_Sum>(data);
    }
}
